<template>
  <el-select :class="props.class" popper-class="select_popper">
    <el-option
      v-for="item in items"
      :key="item.key"
      :label="item.value"
      :value="item.key"
      :disabled="props.disabledItems(item)"
    />
  </el-select>
</template>
<script setup lang="ts">
import type { Entry } from "jmash-core";
import { type PropType } from "vue";

const props = defineProps({
  data: {
    type: Object as PropType<Entry[]>,
    default: "",
  },
  class:{
    type: String,
    default: "!w-[203px]",
  },
  // 是否禁用下拉的列表选项
  disabledItems: {
    type: Function as PropType<(item: Entry) => boolean>,
    default: () => false,
  },
});

const items: Entry[] = props.data;
</script>
<style lang="scss">
.select_popper {
  z-index: 99999 !important;
}
</style>
